<template>
  <div class="app">
    <!-- 头部区域 -->
    <van-nav-bar
      title="cs-2002"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      fixed
    />

    <!-- 路由区域 -->
    <router-view />

    <!-- 底部导航区域 -->
    <van-tabbar v-model="active">
      <van-tabbar-item
        icon="home-o"
        to="/home"
        fixed
      >home</van-tabbar-item>
      <van-tabbar-item
        icon="friends-o"
        to="/frients"
      >friends</van-tabbar-item>
      <!-- info 老版本 badge 新版本 -->
      <van-tabbar-item
        icon="cart-o"
        to="/cart"
        badge="6"
      >cart</van-tabbar-item>
      <van-tabbar-item
        icon="search"
        to="/search"
      >search</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  data: () => ({
    active: 0
  }),
  created() {},
  methods: {
    onClickLeft() {
      this.$router.go(-1)
    }
  }
}
</script>
<style lang="less">
.app{
  margin-top: 46px;
  margin-bottom: 50px;
}
</style>
